import http from '@/api/request'
import type { OaWorkflowRole} from '@/types/workflow'

 

/**
 * 获取docform
 * @param formId 
 */
export const getRolesByUser =  async (userId:string)=>{
    const result =  await http.get<OaWorkflowRole[]>('/workflow/getRolesByUser',{
        userId
    })
    return result;
}

export const getCollegeHeadRoles =  async ()=>{
    const result =  await http.get<OaWorkflowRole[]>('/workflow/getCollegeHeadRoles')
    return result.data;
}

export const getTopRoles =  async (workflowId:number)=>{
    const result =  await http.get<OaWorkflowRole[]>('/workflow/getTopRoles',{workflowId})
    return result.data;
}

export const getChildrenRoles =  async (roleId:string)=>{
    const result =  await http.get<OaWorkflowRole[]>('/workflow/getChildrenRoles',{roleId})
    return result.data;
}

